package com.qf.service.Impl;

import com.github.pagehelper.PageHelper;
import com.qf.dao.Sys_cityDao;
import com.qf.pojo.Sys_city;
import com.qf.service.Sys_cityService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class Sys_cityServiceImpl implements Sys_cityService {

    @Autowired
    Sys_cityDao cityDao;

    /**
     * 查询全部数据
     * @param page
     * @param size
     * @return
     */
    @Override
    public List<Sys_city> selectAll(Integer page, Integer size) {
        PageHelper.startPage(page,size);
        List<Sys_city> cities = cityDao.selectAll();
        return cities;
    }

    /**
     * id查
     * @param id
     * @return
     */
    @Override
    public Sys_city select(Integer id) {
        Sys_city select = cityDao.select(id);
        return select;
    }

    @Override
    public int del(Integer id) {
        int del = cityDao.del(id);
        return del;
    }

    @Override
    public int insert(Sys_city city) {
        int insert = cityDao.insert(city);
        return insert;
    }

    @Override
    public int update(Sys_city city) {
        int update = cityDao.update(city);
        return update;
    }


}
